﻿<local:DocumentBase x:Class="WPFExcelReport.JLTVR04DOC"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    Loaded="Window_Loaded"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Height="700" Width="1024" 
                    Title="JLTVR04DOC"  
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetProd" />
        <CollectionViewSource   x:Key="vwVRKOPF" Source="{Binding Path=VRKOPF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwVRPOS" Source="{Binding Path=VRPOS,Source={StaticResource SetProd}}" />        
        <CollectionViewSource   x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwVVTLIEF" Source="{Binding Path=VVTLIEF,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwVVLIEF" Source="{Binding Path=VVLIEF,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwWBBST" Source="{Binding Path=WBBST,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwVVPACK" Source="{Binding Path=VVPACK,Source={StaticResource SetProd}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="200" />
            <RowDefinition Height="500" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2"  >
            <WrapPanel Name="ZoneOrder">
                <TextBlock FontSize="18"  Height="Auto" Width="Auto">订单号:</TextBlock>
                <TextBox   FontSize="18" Name="txtKRS"  Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <TextBox  FontSize="18" Name="txtLFD"  Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="White" />
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>
                <TextBlock FontSize="18" Height="Auto"  Width="Auto"  Text="发票" Margin="10,0,0,0" />
                <ComboBox  
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwVRKOPF}}"
                    Margin="20,0,0,0"
                    Background="Gray"  MinWidth="100" 
                    DisplayMemberPath="VRKRENR"
                    IsEditable="True"
                    SelectedValuePath="VRKRENR"
                    >
                </ComboBox>
                <Button  Height="30"  Width="30" Margin="10,0,0,0" Click="btnGetData_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Search.png" />
                    </Button.Background>
                </Button>
                <Button  Height="30" Margin="30,0,0,0"  Name="btnPrintPreview" 
                    Width="30" Click="btnPrintPreview_Click" >
                    <Button.Background>
                        <ImageBrush ImageSource="Images/excel_icon.jpg" />
                    </Button.Background>
                </Button>
                <Button   Height="30" Margin="20,0,0,0"  Name="btnPrint" Width="30" Click="btnPrint_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="Images/Print.png" />
                    </Button.Background>
                </Button>                
            </WrapPanel>
        </StackPanel>
        <StackPanel  Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="2">
            <DataGrid
            CanUserReorderColumns="True"  
            CanUserResizeRows="True" 
            CanUserSortColumns="True" 
            AutoGenerateColumns="False"  
            EnableRowVirtualization="True"  
            RowDetailsVisibilityMode="VisibleWhenSelected"
            HorizontalAlignment="Stretch" 
            VerticalAlignment="Stretch"
            IsSynchronizedWithCurrentItem="True" 
            Opacity="10" 
            Visibility="Visible"
            ItemsSource="{Binding Source={StaticResource ResourceKey=vwVRPOS}}" 
            Margin="0,2,0,0" 
            x:Name="dlgVRPOS" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="行" Binding="{Binding VRPREPOS}"/>
                    <DataGridTextColumn Header="" Binding="{Binding VRPAUFKRS}"/>
                    <DataGridTextColumn Header="销售单" Binding="{Binding VRPAUFLFD}"/>
                    <DataGridTextColumn Header="" Binding="{Binding VRPAUFPOS}"/>
                    <DataGridTextColumn Header="发货单" Binding="{Binding VRPLIEFSCH}"/>
                    <DataGridTextColumn Header="总价" Binding="{Binding VRPWAWERT}"/>
                    <DataGridTextColumn Header="数量" Binding="{Binding VRPMENGE}"/>
                    <DataGridTextColumn Header="单价" Binding="{Binding VRPPREIS}"/>
                </DataGrid.Columns>
            </DataGrid  > 
        </StackPanel>        
    </Grid>
</local:DocumentBase>